﻿<%@ Page Title="" Language="C#" MasterPageFile="~/UI/HRAdminUI/AdminMaster.Master"
    AutoEventWireup="true" CodeBehind="PublishNotice.aspx.cs" Inherits="HRM.UI.HRAdminUI.Notice.PublishNotice" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="mainContentBody" runat="server">
    <link href="../../../Styles/Notice/PublishNotice.css" rel="stylesheet" type="text/css" />
    <link href="../../../Scripts/htmlDatePicker.css" rel="stylesheet" type="text/css" />
    <script src="../../../Scripts/htmlDatePicker.js" type="text/javascript"></script>
    <script type="text/javascript" language="javascript">

        function CheckField() {
            if (document.getElementById("<%=txtDate.ClientID%>").value == "") {
                document.getElementById("<%=msgLbl.ClientID%>").textContent = "Please Enter Notice Date!";
                document.getElementById("<%=msgLbl.ClientID%>").style.color = "red";
                document.getElementById("<%=txtDate.ClientID%>").focus();
                return false;
            }
            if (document.getElementById("<%=txtSubject.ClientID%>").Value == "") {
                document.getElementById("<%=msgLbl.ClientID%>").textContent = "Please write Notice Subject!";
                document.getElementById("<%=msgLbl.ClientID%>").style.color = "red";
                document.getElementById("<%=txtSubject.ClientID%>").focus();
                return false;
            }
            if (document.getElementById("<%=txtAuthoruty.ClientID%>").Value == "") {
                document.getElementById("<%=msgLbl.ClientID%>").textContent = "Please write Authority Name!";
                document.getElementById("<%=msgLbl.ClientID%>").style.color = "red";
                document.getElementById("<%=txtAuthoruty.ClientID%>").focus();
                return false;
            }
            return true;
        }
  

    </script>
    <fieldset>
        <legend>Add Notice</legend>
    <table width="80%" align="center">
        <tr>
            <td colspan="2" style="text-align: center">
                <asp:Label runat="server" ID="msgLbl"></asp:Label>
            </td>
        </tr>
        <tr>
            <td class="Label">
                Date:
            </td>
            <td class="Field">
                <input type="text" runat="server" id="txtDate" class="textboxinput" readonly onclick="GetDate(this);" /><span
                    class="estaricStar">*</span>
            </td>
        </tr>
        <tr>
            <td class="Label">
                Subject:
            </td>
            <td class="Field">
                <input type="text" runat="server" id="txtSubject" class="inputTextarea" /><span class="estaricStar">*</span>
            </td>
        </tr>
        <tr>
            <td class="Label">
                Notice Summary:
            </td>
            <td class="Field">
                <textarea cols="30" rows="5" runat="server" id="txtSummary" class="inputTextarea"></textarea>
            </td>
        </tr>
        <tr>
            <td class="Label">
                Add Notice as Image:
            </td>
            <td class="Field">
                <input type="file" runat="server" id="UploadImage" class="inputUplodbox" />
            </td>
        </tr>
        <tr>
            <td class="Label">
                Authority:
            </td>
            <td class="Field">
                <input type="text" runat="server" id="txtAuthoruty" class="textboxinput" /><span
                    class="estaricStar">*</span>
            </td>
        </tr>
        <tr>
            <td>
            </td>
            <td>
                <input type="submit" id="btnPublished" runat="server" value="Published" onserverclick="Published"
                    class="btnCss" onclick="return  CheckField()" />
            </td>
        </tr>
    </table>
    
    </fieldset>
    <div>
        <fieldset>
            <legend>All Notice Lists</legend>
            <asp:GridView runat="server" ID="noticesGdv" Width="100%" AutoGenerateColumns="False"
                OnPageIndexChanging="noticesGdv_PageIndexChanging" AllowPaging="True" PageSize="5"
                CssClass="GridviewStyle" BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px"
                CellPadding="3" OnRowCancelingEdit="noticesGdv_RowCancelingEdit" OnRowDeleting="noticesGdv_RowDeleting">
                <Columns>
                    <asp:TemplateField HeaderText="Notice Title">
                        <ItemTemplate>
                            <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%# Eval("Id","~/UI/NoticeUI/ViewNotice.aspx?id={0}") %>'
                                Text='<%# Eval("Subject") %>'></asp:HyperLink>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Details">
                        <ItemTemplate>
                            <asp:Label ID="Label2" runat="server" Text='<%# Bind("Summary") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Notice Image">
                        <ItemTemplate>
                            <asp:Label ID="Label3" runat="server" Text='<%# Bind("NoticeImage") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Authority">
                        <ItemTemplate>
                            <asp:Label ID="Label4" runat="server" Text='<%# Bind("NoticeBy") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Delete" ShowHeader="False">
                        <ItemTemplate>
                            <asp:LinkButton ID="btnDelete" runat="server" CausesValidation="False" CommandName="Delete"
                                Text="Delete" OnClientClick="confirm('Do You want to delete This Notice?')"></asp:LinkButton>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField Visible="False">
                        <ItemTemplate>
                            <asp:Label ID="lblID" runat="server" Text='<%# Bind("Id") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
                <FooterStyle CssClass="GridViewFooterStyle" />
                <HeaderStyle CssClass="GridViewHeaderStyle" />
                <PagerStyle CssClass="GridViewFooterStyle" HorizontalAlign="Center" />
                <RowStyle ForeColor="#000066" />
                <SelectedRowStyle BackColor="#669999" Font-Bold="True" ForeColor="White" />
                <SortedAscendingCellStyle BackColor="#F1F1F1" />
                <SortedAscendingHeaderStyle BackColor="#007DBB" />
                <SortedDescendingCellStyle BackColor="#CAC9C9" />
                <SortedDescendingHeaderStyle BackColor="#00547E" />
            </asp:GridView>
        </fieldset>
    </div>
</asp:Content>
